<%-- 
    Document   : makeUser
    Created on : Jun 25, 2011, 5:10:40 PM
    Author     : Hung
--%>
<%@include file="include_header.jsp"%>
<%@include file = "admin_redirect.jsp" %>
<jsp:useBean id="userData" scope="application" class="edu.gatech.gellinservlet.model.UserManager" />
<% //make a new user with given values
    String name = request.getParameter("name");
    String password = request.getParameter("pwd");
    String uName = request.getParameter("userName");
    String userType = request.getParameter("userType");
    
    User theUser = User.createUser(userType, name, uName, password);
    userData.add(theUser);
      
   /* if("Student".equals(userType)){
        userData.createStudent(name, uName, password);
   
    }
    else if("Instructor".equals(userType)){
        userData.createInstructor(name, uName, password);
   
    }
    else if("Administrator".equals(userType)){
        userData.createSystemAdmin(name, uName, password);
   
    }*/
  
    response.sendRedirect("createUsers.jsp?code=valid");
    userData.save("userData.ser");
%>
<% } //ends user_redirect else statement, html is included here %>
<% } //ends verifySession.jsp, all html is included in else statment %>